***************************************************************
****Replication file for Ryan E. Carlin & Timothy Hellwig CPS
***************************************************************
use macrodata.dta
gen ortneod = q_dfa4 - q_dfa2
tsset countryid timevar, q
label variable q_dfa4 "neoliberalism"
label variable q_dfa2 "statism"
label variable ortneod "policy regime"
label variable q_traderef "trade reform index"
label variable q_finref "financial reform index"
label variable q_privatization "privatization index"
label variable q_taxref "tax reform index"
label variable q_wwelfarer "worker welfare index"
label variable q_govcon "government consumption"
label variable appappdis "approval"
label variable qa_growth1 "growth"
label variable q_log_inflation "(ln)inflation"
label variable scan08 "scandal"
label variable honeymoon "honeymoon"
sort countryid timevar
***TABLE 3***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation i.ccode if e_growth~=., c(psar1) pair
eststo M1
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 i.ccode if e_growth~=., c(psar1) pair
eststo M2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa4 i.ccode if e_growth~=., c(psar1) pair
eststo M3
test qa_growth1 c.qa_growth1#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa2 i.ccode if e_growth~=., c(psar1) pair
eststo M4
test qa_growth1 c.qa_growth1#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M5
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod c.qa_growth1#c.ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M6
test qa_growth1 c.qa_growth1#c.ortneod
estout M1 M2 M3 M4 M5 M6, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A3 & A4 - PCF****
factor q_traderef q_finref q_taxref q_privatization q_wwelfarer q_govcon, pcf
rotate

***TABLE A6 - replicating T3 w/o country FEs***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation if e_growth~=., c(psar1) pair
eststo M1
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 if e_growth~=., c(psar1) pair
eststo M2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa4 if e_growth~=., c(psar1) pair
eststo M3
test qa_growth1 c.qa_growth1#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa2 if e_growth~=., c(psar1) pair
eststo M4
test qa_growth1 c.qa_growth1#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod if e_growth~=., c(psar1) pair
eststo M5
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod c.qa_growth1#c.ortneod if e_growth~=., c(psar1) pair
eststo M6
test qa_growth1 c.qa_growth1#c.ortneod
estout M1 M2 M3 M4 M5 M6, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A7 - replicating T3 w/ country AND year FEs***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation i.ccode i.year if e_growth~=., c(psar1) pair
eststo M1
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 i.ccode i.year if e_growth~=., c(psar1) pair
eststo M2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa4 i.ccode i.year if e_growth~=., c(psar1) pair
eststo M3
test qa_growth1 c.qa_growth1#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.qa_growth1#c.q_dfa2 i.ccode i.year if e_growth~=., c(psar1) pair
eststo M4
test qa_growth1 c.qa_growth1#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod i.ccode i.year if e_growth~=., c(psar1) pair
eststo M5
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod c.qa_growth1#c.ortneod i.ccode i.year if e_growth~=., c(psar1) pair
eststo M6
test qa_growth1 c.qa_growth1#c.ortneod
estout M1 M2 M3 M4 M5 M6, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A8 - RESULTS WITH SEPARATE REFORM INDICES***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_traderef c.qa_growth1#c.q_traderef i.ccode if e_growth~=., c(psar1) pair
eststo M1
test qa_growth1 c.qa_growth1#c.q_traderef
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_finref c.qa_growth1#c.q_finref i.ccode if e_growth~=., c(psar1) pair
eststo M2
test qa_growth1 c.qa_growth1#c.q_finref
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_taxref c.qa_growth1#c.q_taxref i.ccode if e_growth~=., c(psar1) pair
eststo M3
test qa_growth1 c.qa_growth1#c.q_taxref
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_privatization c.qa_growth1#c.q_privatization i.ccode if e_growth~=., c(psar1) pair
eststo M4
test qa_growth1 c.qa_growth1#c.q_privatization
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_wwelfarer c.qa_growth1#c.q_wwelfarer i.ccode if e_growth~=., c(psar1) pair
eststo M5
test qa_growth1 c.qa_growth1#c.q_wwelfarer
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_govcon c.qa_growth1#c.q_govcon i.ccode if e_growth~=., c(psar1) pair
eststo M6
test qa_growth1 c.qa_growth1#c.q_govcon
estout M1 M2 M3 M4 M5 M6, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A9 - INFLATION INTERACTIVE***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.q_log_inflation#c.q_dfa4 i.ccode if e_growth~=., c(psar1) pair
eststo M1
test q_log_inflation c.q_log_inflation#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation q_dfa4 q_dfa2 c.q_log_inflation#c.q_dfa2 i.ccode if e_growth~=., c(psar1) pair
eststo M2
test q_log_inflation c.q_log_inflation#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod c.q_log_inflation#c.ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M3
test q_log_inflation c.q_log_inflation#c.ortneod
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation left_c c.q_log_inflation#c.left_c i.ccode if e_growth~=., c(psar1) pair
eststo M4
test q_log_inflation c.q_log_inflation#c.left_c
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation left_c c.qa_growth1#c.left_c i.ccode if e_growth~=., c(psar1) pair
eststo M5
test qa_growth1 c.qa_growth1#c.left_c
estout M1 M2 M3 M4 M5, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A10 - controls for presidential type***
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation left_c c.qa_growth1#c.left_c i.ccode if e_growth~=., c(psar1) pair
eststo M1
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod left_c c.qa_growth1#c.left_c c.qa_growth1#c.ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod left_c c.qa_growth1#c.left_c c.qa_growth1#c.ortneod c.left_c#c.ortneod c.qa_growth1#c.left_c#c.ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M3
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation pbreak_v c.qa_growth1#c.pbreak_v i.ccode if e_growth~=., c(psar1) pair
eststo M4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation ortneod pbreak_v c.qa_growth1#c.pbreak_v c.qa_growth1#c.ortneod i.ccode if e_growth~=., c(psar1) pair
eststo M5
estout M1 M2 M3 M4 M5, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A11 - replication of Table 3 with 'differences'***
/*creating differences from policy levels at beginning of administration*/
gen dq_dfa4 = q_dfa4 - q_dfa4np 
gen dq_dfa2 = q_dfa2 - q_dfa2np 
gen ortneodnp = q_dfa4np - q_dfa2np
gen dortneod = ortneod - ortneodnp
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation dq_dfa4 dq_dfa2 i.ccode if e_growth~=., c(psar1) pair
eststo M1
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation dq_dfa4 dq_dfa2 c.qa_growth1#c.dq_dfa4 i.ccode if e_growth~=., c(psar1) pair
eststo M2
test qa_growth1 c.qa_growth1#c.dq_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation dq_dfa4 dq_dfa2 c.qa_growth1#c.dq_dfa2 i.ccode if e_growth~=., c(psar1) pair
eststo M3
test qa_growth1 c.qa_growth1#c.dq_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation dortneod i.ccode if e_growth~=., c(psar1) pair
eststo M4
xtpcse appappdis l.appappdis honeymoon scan08 qa_growth1 q_log_inflation dortneod c.qa_growth1#c.dortneod i.ccode if e_growth~=., c(psar1) pair
eststo M5
test qa_growth1 c.qa_growth1#c.dortneod
estout M1 M2 M3 M4 M5, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

***TABLE A13 - models with ICC***
xtpcse appappdis l.appappdis honeymoon scan08 icc100 q_dfa4 q_dfa2 c.icc100#c.q_dfa4 if e~=., c(psar1) pair
eststo M4
test icc100 c.icc100#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 icc100 q_dfa4 q_dfa2 c.icc100#c.q_dfa2 if e~=., c(psar1) pair
eststo M5
test icc100 c.icc100#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 icc100 ortneod c.icc100#c.ortneod if e~=., c(psar1) pair
eststo M6
test icc100 c.icc100#c.ortneod
xtpcse appappdis l.appappdis honeymoon scan08 icc100 q_dfa4 q_dfa2 c.icc100#c.q_dfa4 i.ccode if e~=., c(psar1) pair
eststo M1
test icc100 c.icc100#c.q_dfa4
xtpcse appappdis l.appappdis honeymoon scan08 icc100 q_dfa4 q_dfa2 c.icc100#c.q_dfa2 i.ccode if e~=., c(psar1) pair
eststo M2
test icc100 c.icc100#c.q_dfa2
xtpcse appappdis l.appappdis honeymoon scan08 icc100 ortneod c.icc100#c.ortneod i.ccode if e~=., c(psar1) pair
eststo M3
test icc100 c.icc100#c.ortneod
estout M1 M2 M3 M4 M5 M6, cells(b(star fmt(%9.3f)) se(par)) stats(N r2, fmt(%9.3f %9.0g)) legend label collabels(none) varlabels(_cons Constant) starlevels(+ 0.10 * 0.05 ** 0.01)

************************************************************************************************************************
***FIGURE 2 
************************************************************************************************************************
gen groxdfa4 = qa_growth1*q_dfa4
gen groxdfa2 = qa_growth1*q_dfa2
gen groxord = qa_growth1*ortneod
gen groxtrade = qa_growth1*q_traderef
gen groxfin = qa_growth1*q_finref
gen groxtax = qa_growth1*q_taxref
gen groxpriv = qa_growth1*q_privatization
gen groxwwel = qa_growth1*q_wwelfarer
gen groxgcon = qa_growth1*q_govcon
gen lag_appappdis = l.appappdis
***fig2A***
qui xtpcse appappdis qa_growth1 q_dfa4 groxdfa4 q_dfa2 honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)2 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("A. Table 3 Model 3") xtitle("Neoliberalism") legend(off) scheme(s1mono) name(me_grodfa4, replace) nodraw

***fig2B***
qui xtpcse appappdis qa_growth1 q_dfa2 groxdfa2 q_dfa4 honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)2 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("B. Table 3 Model 4") xtitle("Statism") legend(off) scheme(s1mono) name(me_grodfa2, replace) nodraw

***fig2C***
qui xtpcse appappdis qa_growth1 ortneod groxord honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -4(.25)4 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("C. Table 3 Model 6") xtitle("Policy Regime") legend(off) scheme(s1mono) name(me_groord, replace) nodraw

***fig3A***
xtpcse appappdis qa_growth1 q_traderef groxtrade honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist .7(.025)1 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("A. Model 1") xtitle("Trade Reforms") legend(off) scheme(s1mono) name(me_grotrade_one, replace) nodraw

***fig3B***
xtpcse appappdis qa_growth1 q_finref groxfin honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist .475(.025)1 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("B. Model 2") xtitle("Financial Reforms") legend(off) scheme(s1mono) name(me_grofin_one, replace) nodraw

***fig3C***
xtpcse appappdis qa_growth1 q_taxref groxtax honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist .35(.025).65 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("C. Model 3") xtitle("Tax Reforms") legend(off) scheme(s1mono) name(me_grotax_one, replace) nodraw

***fig3D***
xtpcse appappdis qa_growth1 q_privatization groxpriv honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist 0(.025).7 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("D. Model 4") xtitle("Privatization") legend(off) scheme(s1mono) name(me_gropriv_one, replace) nodraw

***fig3E***
xtpcse appappdis qa_growth1 q_wwelfarer groxwwel honeymoon scan08 q_log_inflation lag_appappdis if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist 0.1(.05).5 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.65*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("E. Model 5") xtitle("Worker Welfare") legend(off) scheme(s1mono) name(me_growwel_one, replace) nodraw

***fig3F***
xtpcse appappdis qa_growth1 q_govcon groxgcon honeymoon scan08 q_log_inflation lag_appappdis i.ccode if e_growth~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist 0.05(.025).2 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.65*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for consumer confidence is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("F. Model 6") xtitle("Government Consumption") legend(off) scheme(s1mono) name(me_grogcon_one, replace) nodraw
graph combine me_grodfa4 me_grodfa2 me_groord, scheme(s1mono) ycommon row(1)
graph save Graph "fig2.gph", replace
graph combine me_grotrade_one me_grofin_one me_grotax_one me_gropriv_one me_growwel_one me_grogcon_one, scheme(s1mono) ycommon row(2)
graph save Graph "fig3.gph", replace

************************************************************************************************************************
***FIGURE A1 - REPLICATING FIGURE 2 BUT W/O FEs
************************************************************************************************************************
***figA1a***
qui xtpcse appappdis qa_growth1 q_dfa4 groxdfa4 q_dfa2 honeymoon scan08 q_log_inflation lag_appappdis if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)3.5 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("A. Model 3") xtitle("Neoliberalism") ytitle("ME of Growth") legend(off) scheme(s1mono) name(nofe_grodfa4, replace) nodraw

***figA1b***
qui xtpcse appappdis qa_growth1 q_dfa2 groxdfa2 q_dfa4 honeymoon scan08 q_log_inflation lag_appappdis if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)2 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("B. Model 4") xtitle("Statism") ytitle("ME of Growth") legend(off) scheme(s1mono) name(nofe_grodfa2, replace) nodraw

***figA1c***
qui xtpcse appappdis qa_growth1 ortneod groxord honeymoon scan08 q_log_inflation lag_appappdis if e_growth~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)5.5 {
	local n = 1
	qui gen conb = (b1*3.33) + (b3*3.33*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for growth is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("C. Model 6") xtitle("Policy Regime") ytitle("ME of Growth") legend(off) scheme(s1mono) name(nofe_groord, replace) nodraw
graph combine nofe_grodfa4 nofe_grodfa2 nofe_groord, scheme(s1mono) 
graph save Graph "figA1.gph", replace

************************************************************************************************************************
***FIGURE A2 - triple interaction with left president
************************************************************************************************************************
xtpcse appappdis l.appappdis honeymoon scan08 q_log_inflation c.qa_growth1##c.ortneod##c.left_comb i.ccode if e_growth~=., c(psar1) pair
quietly: margins , dydx(qa_growth1) at( ortneod=(-2(.25)4) left_comb=(0)) level(95)
marginsplot, recast(line) recastci(rline) yline(0) title("A. Non-Left Presidents") xtitle("Policy Regime") legend(off) scheme(s1mono) name(me_nonleft, replace) nodraw
quietly: margins , dydx(qa_growth) at( ortneod=(-2(.25)4) left_comb=(1)) level(95)
marginsplot, recast(line) recastci(rline) yline(0) title("B. Left Presidents") xtitle("Policy Regime") legend(off) scheme(s1mono) name(me_left, replace) nodraw
graph combine me_nonleft me_left, scheme(s1mono) ycommon row(1)
graph save Graph "figA2.gph", replace

************************************************************************************************************************
***FIGURE A3 -ICC
************************************************************************************************************************
gen i100xdfa4 = icc100*q_dfa4
gen i100xdfa2 = icc100*q_dfa2
gen i100xord = icc100*ortneod 
***figA3a***
qui xtpcse appappdis icc100 q_dfa4 i100xdfa4 honeymoon scan08 q_dfa2 lag_appappdis if e~=., c(psar1) pair
matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist 0(.25)4.5 {
	local n = 1
	qui gen conb = b1 + (b3*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for consumer confidence is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("A. Model 3") xtitle("Neoliberalism") ytitle("ME of Consumer Confidence") legend(off) scheme(s1mono) name(me_iccdfa4, replace) nodraw

***figA3b***
qui xtpcse appappdis icc100 q_dfa2 i100xdfa2 honeymoon scan08 q_dfa4 lag_appappdis if e~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -1.5(.25)2 {
	local n = 1
	qui gen conb = b1 + (b3*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for consumer confidence is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("B. Model 4") xtitle("Statism") ytitle("ME of Consumer Confidence") legend(off) scheme(s1mono) name(me_iccdfa2, replace) nodraw

***figA3c***
qui xtpcse appappdis icc100 ortneod i100xord honeymoon scan08 lag_appappdis if e~=., c(psar1) pair

matrix b=e(b) 
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1] 
scalar varb3=V[3,3]
scalar covb1b3=V[1,3] 

capture drop vectaxis me lower_ci upper_ci
gen vectaxis = .
gen me = .
gen lower_ci = .
gen upper_ci = .
local b = 1

foreach i of numlist -2(.25)4 {
	local n = 1
	qui gen conb = b1 + (b3*(`i'))
	local conse = sqrt(varb1+varb3*((`i')^2)+2*covb1b3*(`i'))
	qui gen x=1.96*`conse'
 	qui gen upper=conb+x
	qui gen lower=conb-x
	qui sum conb
		local me = `r(mean)'
		replace me = `me' in `b'
	qui sum lower 
		local lower_ci = `r(mean)'
		replace lower_ci = `lower_ci' in `b'
	qui sum upper
		local upper_ci = `r(mean)'
		replace upper_ci = `upper_ci' in `b'
	di
	di
	di "The marginal effect for consumer confidence is " `me'
	di "The confidence interval is " `lower_ci' 	"	and		"	`upper_ci'
	di "The modifying variable is = 	" `i'
	di 
	di
	capture drop conb* x* upper lower
	replace vectaxis = `i' in `b'
	local b = `b' + 1
	local n = `n' + 1
}

twoway (line me vectaxis, clpattern(solid) sort) (line lower_ci vectaxis, clpattern(dash) sort) (line upper_ci vectaxis, clpattern(dash) sort), yline(0) title("C. Model 6") xtitle("Policy Regime") ytitle("ME of Consumer Confidence") legend(off) scheme(s1mono) name(me_iccord, replace) nodraw
graph combine me_iccdfa4 me_iccdfa2 me_iccord, scheme(s1mono)  
graph save Graph "figA3.gph", replace
